from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from django.urls import reverse


# Create your views here.
a = '123'
b = '123'


def login_view(request):
    if request.method == 'POST':
        a1 = request.POST.get('username')
        b1 = request.POST.get('password')
        global a
        a = a1
        global b
        b = b1
        return HttpResponseRedirect(reverse('register'))
    return render(request, 'login.html')


def register_view(request):
    return render(request, 'register.html', context={'a': a})


def home_view(request):
    return HttpResponse('Welcome to the home page!')
